package com.fulihui.wgj.facade.service.template;

import com.fulihui.common.error.InvokeServiceException;
import com.fulihui.common.result.rpc.BaseResult;
import com.fulihui.common.result.rpc.SimpleResult;
import com.fulihui.wgj.facade.dto.WxSendTemplateLogDTO;
import com.fulihui.wgj.facade.request.PrimaryKeyRequest;
import com.fulihui.wgj.facade.request.template.SendTemplateLogCancelRequest;
import com.fulihui.wgj.facade.request.template.SendTemplateLogPageQueryRequest;
import com.fulihui.wgj.facade.request.template.SendTemplateLogQueryRequest;
import com.fulihui.wgj.facade.request.template.TemplateLogSendUpdateRequest;
import com.fulihui.wgj.facade.result.template.SendTemplateLogPageResult;

import java.util.List;

/**
 * 模板模板发送记录Service
 *
 * @author wang_wx
 * @date 2018-07-26
 */
public interface SendTemplateLogService {

    /**
     * 查询发送记录-分页
     *
     * @param request
     * @return
     * @throws InvokeServiceException
     */
    SendTemplateLogPageResult pageQuerySendLogs(SendTemplateLogPageQueryRequest request) throws InvokeServiceException;

    /**
     * 查询发送记录-不分页
     *
     * @param request
     * @return
     * @throws InvokeServiceException
     */
    SimpleResult<List<WxSendTemplateLogDTO>> querySendLogs(SendTemplateLogQueryRequest request) throws InvokeServiceException;

    /**
     * 查询发送记录-for定时任务
     *
     * @return
     */
    SimpleResult<List<WxSendTemplateLogDTO>> querySendLogs4Job();

    /**
     * 取消模板发送
     *
     * @param request
     * @return
     * @throws InvokeServiceException
     */
    BaseResult cancelSendLog(SendTemplateLogCancelRequest request) throws InvokeServiceException;

    /**
     * 模板记录发送更新--如成功数、失败数、状态等--累加原来的数字
     *
     * @param request
     * @return
     * @throws InvokeServiceException
     */
    BaseResult updateSendRecordAccumulate(TemplateLogSendUpdateRequest request) throws InvokeServiceException;

    /**
     * 根据主键查询模板发送记录
     *
     * @param request
     * @return
     * @throws InvokeServiceException
     */
    SimpleResult<WxSendTemplateLogDTO> querySendLogById(PrimaryKeyRequest request) throws InvokeServiceException;
}
